package com.von.nhcf.api;

import com.von.nhcf.entity.po.MemberPO;
import com.von.nhcf.entity.vo.*;
import com.von.nhcf.util.ResultEntity;
import feign.Param;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.xml.soap.Detail;
import java.util.List;

@FeignClient("mysqlprovider")
public interface MysqlRemoteService {
    @RequestMapping("/get/member/by/username")
    ResultEntity<MemberPO> getMemberByUsername(@RequestParam("loginacct")String username);

    @RequestMapping("/save/member/remote")
    ResultEntity saveMemberRemote(@RequestBody MemberPO memberPO);

    @RequestMapping("/save/project/vo/remote")
    ResultEntity<String> saveProjectVORemote(@RequestBody ProjectVO projectVO, @RequestParam("memberId") Integer memberId);

    @RequestMapping("/get/project/type/vo/remote")
    ResultEntity<List<PortalTypeVO>> getProjectTypeVORemote();

    @RequestMapping("/get/detail/project/vo/remote/{projectId}")
    ResultEntity<DetailProjectVO> getDetailProjectVORemote(@PathVariable("projectId") Integer id);

    @RequestMapping("/get/order/project/vo/remote")
    ResultEntity<OrderProjectVO> getProjectVORemote(@RequestParam("projectId")Integer projectId,
                                                    @RequestParam("returnId") Integer returnId);

    @RequestMapping("/get/order/address/vo/remote")
    ResultEntity<List<AddressVO>> getAddressVORemote(@RequestParam("memberId") Integer memberId);

    @RequestMapping("/save/order/address/po/remote")
    void saveAddressRemote(@RequestBody AddressVO addressVO);

    @RequestMapping("/save/order/vo/remote")
    void saveOrderRemote(@RequestBody OrderVO orderVO);
}
